package game;


import java.awt.Point;
import java.awt.Rectangle;

public class Mine extends AnimatedSprite
{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	boolean detonada = false;
	int nMines;
	
	public Mine(Point posicao)
	{
		super(27, posicao, new Point(19,35), new Point(0,0), new Point(19,35), new Point(2,1), 0.5f, false);

	}
	
	public void Update(Rectangle[] rect)
	{	
		super.Update();
		
		Rectangle a = new Rectangle((int)this.position.getX(),(int)this.position.getY(),(int)this.dimension.x, (int)this.dimension.y);
		
		for(int i = 0; i < rect.length; i++)
		{
			
			if(rect[i].intersects(a))
			{
				Explosao.IniciarExplosao(new Rectangle((int)this.getPosition().getX() - 20, (int)this.getPosition().getY() - 20, 90, 90), 0.03f);
				BaseLevel.Remover(i);
				detonada = true;
				break;
			}
		}
		
	}
}
